﻿using UnityEngine;
#if UNITY_EDITOR
using UnityEditor;
using UnityEditorInternal;
using System.Collections.Generic;
#endif

public class TagAttribute : PropertyAttribute
{
	public TagAttribute()
	{

	}
}

#if UNITY_EDITOR
[CustomPropertyDrawer(typeof(TagAttribute))]
public class TagDrawer : PropertyDrawer
{
	public override void OnGUI (Rect position, SerializedProperty property, GUIContent label)
	{
		List<string> layers = new List<string>(InternalEditorUtility.tags);

		int n = EditorGUI.Popup(position, label.text, layers.IndexOf(property.stringValue), layers.ToArray());
		if (n != -1)
		{
			property.stringValue = layers[n];
		}
	}
}
#endif
